package com.itheima.domain;

import java.io.Serializable;

/**
 * @author lxk on 2017/11/1
 */
//序列化：把对象转换为字节序列的过程
//反序列化：把字节序列恢复为对象的过程
public class FlyPig implements Serializable {//异常: java.io.NotSerializableException: com.itheima.domain.FlyPig
    //自动给你赋值个一长串数字,强烈建议 所有可序列化类都显式声明 serialVersionUID 值，一般写1L即可；
    //不指定serialVersionUID，则增加减少字段会报错
    private static final long serialVersionUID = 1L;

    private static String AGE/* = "AGE"*/ ;
    private String name;
    private String color;
    transient private String car;//static 和 transient 修饰的字段是不会被序列化的。
    private String addTip;

    public String getAGE() {
        return AGE;
    }

    public void setAGE(String AGE) {
        FlyPig.AGE = AGE;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getCar() {
        return car;
    }

    public void setCar(String car) {
        this.car = car;
    }

    //public String getAddTip() {
    //    return addTip;
    //}
    //
    //public void setAddTip(String addTip) {
    //    this.addTip = addTip;
    //}

    @Override
    public String toString() {
        return "FlyPig{" +
                "name='" + name + '\'' +
                ", color='" + color + '\'' +
                ", car='" + car + '\'' +
                ", AGE='" + AGE + '\'' +
                //", addTip='" + addTip + '\'' +
                '}';
    }
}